export default {
  name: __NAME__,
  version: __VERSION__,
  description: __DESCRIPTION__,
  datav: {
    cn_name: "echarts柱状图",
    icon: "icon.png",
    protocol: 1, // 协议版本号
    type: ["echarts_bar"], // 组件类型
    view: {
      width: 300,
      height: 200,
      minWidth: 100,
      minHeight: 50,
    },
    apis: {
      source: {
        handler: "render",
        description: "echarts动画延迟柱状图接口描述",
        fields: {
          product: {
            description: "x坐标轴值",
          },
          2015: {
            description: "y坐标轴值",
          },
          2016: {
            description: "系列值",
            optional: true,
          },
        },
      },
    },
    config: {
      chart: {
        name: "图表",
        type: "menu",
        children: {
          base: {
            name: "图表",
            mode: "single",
            children: {
              legend: {
                name: "图例",
                type: "group",
                children: {
                  show: {
                    name: "显示",
                    type: "boolean",
                    default: true,
                  },
                  left: {
                    name: "左侧",
                    type: "text",
                    default: "42%",
                  },
                  top: {
                    name: "顶部",
                    type: "text",
                    default: "auto",
                  },
                  right: {
                    name: "右侧",
                    type: "text",
                    default: "auto",
                  },
                  bottom: {
                    name: "底部",
                    type: "text",
                    default: "auto",
                  },
                  width: {
                    name: "宽度",
                    type: "text",
                    default: "auto",
                  },
                  height: {
                    name: "高度",
                    type: "text",
                    default: "auto",
                  },
                },
                fold: true,
              },
              tooltip: {
                name: "提示框",
                type: "group",
                children: {
                  show: {
                    name: "显示",
                    type: "boolean",
                    default: true,
                  },
                },
                fold: true,
              },
            },
          },
          axis: {
            name: "坐标轴",
            mode: "multiple",
            children: {
              xAxis: {
                name: "x轴",
                type: "group",
                children: {
                  show: {
                    name: "显示",
                    type: "boolean",
                    default: true,
                  },
                  type: {
                    name: "坐标轴类型",
                    type: "text",
                    default: "category",
                  },
                },
                fold: true,
              },
              yAxis: {
                name: "y轴",
                type: "group",
                children: {
                  show: {
                    name: "显示",
                    type: "boolean",
                    default: true,
                  },
                },
                fold: true,
              },
            },
          },
          series: {
            name: "序列集",
            mode: "single",
            children: {
              series: {
                name: "序列",
                type: "tabs",
                default: [],
                maxTabs: 10, // 最多多少个
                tabPosition: "top", // left top 二选一
                collapseIndex: 1, // 默认展开 0-1
                template: {
                  name: "系列",
                  children: {
                    /*name: {
                      name: '名称',
                      type: 'text',
                      default: '',
                    },*/
                    type: {
                      name: "类别",
                      type: "text",
                      default: "bar",
                    },
                    /*barWidth: {
                      name: '柱子宽度',
                      type: 'text',
                      default: '50%',
                    },
                    barGap: {
                      name: '柱状图间隔',
                      type: 'text',
                      default: '30%',
                    },
                    barCategoryGap: {
                      name: '类目间柱子间距',
                      type: 'text',
                      default: '20%',
                    },*/
                  },
                },
                addable: true, // 是否动态
                children: [
                  {
                    name: "序列1",
                    children: {
                      type: {
                        name: "类别",
                        type: "text",
                        default: "bar",
                      },
                    },
                  },
                  {
                    name: "序列2",
                    children: {
                      type: {
                        name: "类别",
                        type: "text",
                        default: "bar",
                      },
                    },
                  },
                  {
                    name: "序列3",
                    children: {
                      type: {
                        name: "类别",
                        type: "text",
                        default: "bar",
                      },
                    },
                  },
                ],
              },
              dataset: {
                name: "数据集",
                type: "group",
                children: {
                  dimensions: {
                    name: "维度",
                    type: "tabs",
                    default: [],
                    maxTabs: 10, // 最多多少个
                    tabPosition: "top", // left top 二选一
                    collapseIndex: 1, // 默认展开 0-1
                    template: {
                      name: "维度",
                      children: {
                        name: {
                          name: "名称",
                          type: "text",
                          default: "",
                        },
                        type: {
                          name: "类别",
                          type: "text",
                          default: "",
                        },
                      },
                    },
                    addable: true, // 是否动态
                    children: [
                      {
                        name: "维度1",
                        children: {
                          name: {
                            name: "名称",
                            default: "product",
                            type: "text",
                          },
                        },
                      },
                      {
                        name: "维度2",
                        children: {
                          name: {
                            name: "名称",
                            default: "2015",
                            type: "text",
                          },
                        },
                      },
                    ],
                  },
                },
              },
            },
          },
          other: {
            name: "其他",
            mode: "single",
            children: {
              animation: {
                name: "动画",
                type: "boolean",
                default: true,
              },
              animationThreshold: {
                name: "动画阈值",
                type: "number",
                default: 2000,
              },
              animationDuration: {
                name: "动画时长",
                type: "number",
                default: 1000,
              },
              animationEasing: {
                name: "缓动效果",
                type: "text",
                default: "elasticOut",
              },
            },
          },
        },
      },
    },
    api_data: {
      source: [
        { product: "Matcha Latte", 2015: 43.3, 2016: 85.8, 2017: 93.7 },
        { product: "Milk Tea", 2015: 83.1, 2016: 73.4, 2017: 55.1 },
        { product: "Cheese Cocoa", 2015: 86.4, 2016: 65.2, 2017: 82.5 },
        { product: "Walnut Brownie", 2015: 72.4, 2016: 53.9, 2017: 39.1 },
      ],
    },
  },
};
